package cn.misterhou;

import cn.misterhou.test.beans.BeanConfiguration;
import cn.misterhou.test.beans.User;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class Main {
    public static void main(String[] args) {
        // org.springframework.context.annotation.AnnotationConfigUtils.registerAnnotationConfigProcessors
        // org.springframework.context.annotation.ConfigurationClassPostProcessor
        // org.springframework.context.annotation.ConfigurationClassParser.parse
        // org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(注册注解标识的 BeanDefinition)


        // org.springframework.context.annotation.EnableAspectJAutoProxy
        // org.springframework.aop.aspectj.annotation.AnnotationAwareAspectJAutoProxyCreator
        // org.springframework.aop.aspectj.annotation.AnnotationAwareAspectJAutoProxyCreator.findCandidateAdvisors
        // org.springframework.aop.aspectj.annotation.ReflectiveAspectJAdvisorFactory
        // org.springframework.aop.aspectj.annotation.ReflectiveAspectJAdvisorFactory.getAdvisors
        // org.springframework.aop.aspectj.annotation.InstantiationModelAwarePointcutAdvisorImpl
        // org.springframework.aop.aspectj.AspectJAroundAdvice
        // org.springframework.aop.aspectj.AspectJMethodBeforeAdvice
        // org.springframework.aop.aspectj.AspectJAfterAdvice
        // org.springframework.aop.aspectj.AspectJAfterReturningAdvice
        // org.springframework.aop.aspectj.AspectJAfterThrowingAdvice

        // org.springframework.aop.framework.ProxyFactory.getProxy(java.lang.ClassLoader)
        // org.springframework.aop.framework.DefaultAopProxyFactory.createAopProxy
        // org.springframework.aop.framework.AopProxy
        // org.springframework.aop.framework.JdkDynamicAopProxy
        // org.springframework.aop.framework.ObjenesisCglibAopProxy
        // org.springframework.aop.framework.JdkDynamicAopProxy.invoke
        // org.springframework.aop.framework.AdvisedSupport.getInterceptorsAndDynamicInterceptionAdvice
        // org.springframework.aop.framework.DefaultAdvisorChainFactory.getInterceptorsAndDynamicInterceptionAdvice

        // org.springframework.aop.framework.adapter.DefaultAdvisorAdapterRegistry.getInterceptors
        //          org.springframework.aop.aspectj.annotation.InstantiationModelAwarePointcutAdvisorImpl.getAdvice
        // org.aopalliance.intercept.MethodInterceptor
        // org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor
        // org.springframework.aop.framework.adapter.AfterReturningAdviceInterceptor
        // org.springframework.aop.framework.adapter.ThrowsAdviceInterceptor

        // org.springframework.aop.framework.InterceptorAndDynamicMethodMatcher
        // org.aopalliance.intercept.Joinpoint.proceed
        // org.springframework.aop.framework.ReflectiveMethodInvocation.proceed


        // org.springframework.jdbc.support.JdbcTransactionManager
        // org.springframework.transaction.annotation.EnableTransactionManagement
        // org.springframework.transaction.annotation.TransactionManagementConfigurationSelector
        // org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration
        // org.springframework.transaction.interceptor.BeanFactoryTransactionAttributeSourceAdvisor
        // org.springframework.transaction.interceptor.TransactionInterceptor
        // org.springframework.transaction.annotation.AnnotationTransactionAttributeSource
        AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext(BeanConfiguration.class);
        System.out.println(applicationContext.getId());
        User user = applicationContext.getBean(User.class);
        System.out.println(user);
    }
}